package com.zhiliao.iterator.demo1;

/**
 * 作者： zhi-liao
 * 类的作用:
 * 类的创建时间： 2021/5/23 16:52
 */
public class Client {
    public static void main(String[] args) {
        Aggregate aggregate = new ConcreteAggregate();
        aggregate.add("tom");
        aggregate.add("jack");
        aggregate.add("snoopy");

        Iterator iterator = aggregate.iterator();
        while (iterator.hasNext()) {
            String name = (String) iterator.next();
            System.out.println(name);
        }
    }
}
